<%@page import="school.entity.Grade"%>
<%@page import="school.dao.GradeDao"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'addStudent.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
      <form action="doAddStudent.jsp" method="post" enctype="multipart/form-data">
  		<fieldset style="align:center; width: 300px" >
			<legend>注册</legend>
			<!-- <p>学号：<input type="text" name="stuno" value="" /></p> --> 
	  		<p>姓名：<input type="text" name="sname" value=""/></p> 
	  		<p>性别：
	  			<input name="sex" type="radio" value="男" checked/>男
				<input name="sex" type="radio" value="女" />女
				<input name="sex" type="radio" value="妖" />妖
	  		</p> 
	  		<p>生日：<input type="text" name="bithday" value=""/></p> 
	  		<p>加入时间：<input type="text" name="enterdate" value=""/></p> 
	  		<p>QQ：<input type="text" name="qq" value=""/></p> 
	  		<p>祖籍：<input type="text" name="fromcity" value=""/></p> 
	  		
	  		<p>密码：<input type="password" name="pass" value="" /></p>
	 
			<p>年级：<select name="gradeid">
			<%
				GradeDao dao=new GradeDao();
				List<Grade> list=dao.findALL();
				for(Grade g:list){ %> 
				<option value="<%=g.getId()%>" ><%=g.getGname()%></option>
			<%	
				}
		    %>
	  		</select></p>
	  		<p>
	  		照片：<input type="file" name="headpic" accept="image/*"/>
	  		</p>
	  		</p>	
		<p><input type="submit" name="submit"  value="提交" />
			<input type="button" style="margin-left: 50px" value ="返回" onclick="window.location.href='pages/Students.jsp'"/>
			</p>
		</fieldset>
  		</form>	
  </body>
</html>
